package org.jimmy.tang.designpattern.behavior.chain;

/**
 * @author jimmy
 * 
 */
public class PMRequestHandle implements RequestHandle {
    RequestHandle rh;

    public PMRequestHandle(RequestHandle rh) {
        this.rh = rh;
    }

    /* (non-Javadoc)
     * @see org.jimmy.tang.designpattern.behavior.chain.RequestHandle#handleRequest(org.jimmy.tang.designpattern.behavior.chain.Request)
     */
    @Override
    public void handleRequest(Request request) {
        if (request instanceof AddMoneyRequest) {
            System.out.println("Add money, PM approve.");
        } else {
            rh.handleRequest(request);
        }

    }

}
